<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .main {
            width: 500px;
            height: 500px;
            background: skyblue;
            display: flex;
           /* justify-content属性值：
            flex-start 默认值。子元素位于容器的开头。
            flex-end 子元素位于容器的结尾。
            center 子元素位于容器的中心。
            space-between 子元素位于各行之间留有空白的容器内。
            space-around 子元素位于各行之前、之间、之后都留有空白的容器内。*/
            justify-content:space-around;
            flex-direction: row-reverse;
            flex-wrap: wrap;
        }

        .main div {
            width: 100px;
            height: 100px;
            background: pink;
            font-size: 20px;
        }
    </style>
</head>

<body>
<div class="main">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</div>
</body>

</html>
